package com.css.Thread;
//守护线程
public class daemon {

    public static void main(String[] args) {
        God god=new God();
        You you=new You();
        Thread thread=new Thread(god);
        thread.setDaemon(true);
        thread.start();
        new Thread(you).start();
    }


}
class You implements  Runnable{
    public void run() {
        for (int i = 0; i < 36500; i++) {
            System.out.println("开心的活着");
        }
        System.out.println("bye");
    }
}
class God implements Runnable{
    public void run() {
        while (true){
            System.out.println("上帝守护着你");
        }
    }
}


